//
//  notifyView.m
//  PropertyMananger
//
//  Created by bh on 16/12/22.
//  Copyright © 2016年 BH. All rights reserved.
//

#import "notifyView.h"

@implementation NotifyView

- (instancetype)initWithFrame:(CGRect)frame
{

    self = [super initWithFrame:frame];
    if (self) {
        
        [self setupUI];
    }
    return self;
}
- (void)setupUI{

    self.bgView = [[UIView alloc]init];
 //  self.bgView.backgroundColor = [UIColor redColor];
    [self addSubview:self.bgView];
    
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self).with.offset(0);
        make.top.equalTo(self).with.offset(0);
        make.size.mas_equalTo(CGSizeMake(BHscreenW, 35));
    }];
    
    //notice
    self.noticeImg = [[UIImageView alloc]init];
    [self addSubview:self.noticeImg];
    self.noticeImg.image = [UIImage imageNamed:@"ico_home_notice"];
    [self.noticeImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.bgView).with.offset(8);
        make.centerY.equalTo(self.bgView).with.offset(0);
        make.size.mas_equalTo(CGSizeMake(20, 20));
    }];
    
    //标题
    self.titleLabel= [[UILabel alloc]init];
    [self addSubview:self.titleLabel];
    self.titleLabel.text = @"小区通知";
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    self.titleLabel.textColor = Theme_Color;
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.noticeImg).with.offset(20);
        make.top.equalTo(self.noticeImg).with.offset(-5);
        make.size.mas_equalTo(CGSizeMake(130, 30));
    }];
   
    UIView * lineView = [[UIView alloc]init];
    [self addSubview:lineView];
    lineView.backgroundColor = BHColor(238, 238, 238);
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self).with.offset(0);
        make.top.equalTo(self.mas_bottom).with.offset(0);
        make.size.mas_equalTo(CGSizeMake(BHscreenW, 10));
    }];
    
    

    
    
    
    
    
}
@end
